package bai.myworld.mapper.shop;

import bai.myworld.pojo.entity.shop.Product;
import bai.myworld.pojo.entity.shop.ProductSku;
import bai.myworld.pojo.entity.shop.ProductSpecification;
import bai.myworld.pojo.entity.shop.Shop;
import bai.myworld.pojo.vo.shop.ProductDetailVO;
import bai.myworld.pojo.vo.shop.ProductSkuVO;
import bai.myworld.pojo.vo.shop.ProductSpecGroupVO;
import bai.myworld.pojo.vo.shop.ProductSpecVO;
import org.apache.ibatis.annotations.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface ProductMapper {
    /**
     * 最简单的商品查询 - 根据ID获取商品
     * 示例SQL：SELECT * FROM products WHERE id = 1
     */
    @Select("SELECT * FROM products WHERE id = #{productId}")
    Product getProduct(Long productId);
    /**
     *  根据shopID获取商铺信息
     */
    @Select("SELECT * FROM shops WHERE id = #{shopId}")
    Shop getShop(Long shopId);
    /**
     *  productId获取产品sku
     */
    @Select("SELECT * FROM product_skus WHERE product_id = #{productId}")
    List<ProductSku> getProductSkuList(Long productId);
    /**
     *  productId获取产品sku
     */
    @Select("SELECT * FROM product_skus WHERE id = #{skuId}")
    ProductSku getProductSku(Long skuId);
    /**
     *  获取产品sku
     */
    @Select("SELECT * FROM sku_specifications WHERE sku_id = #{skuId}")
    List<ProductSpecification> getSkuSpecifications(Long skuId);




}
